package com.cheng.im.service.group.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheng.im.service.group.domain.ImGroup;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;

/**
* @author Cheng
* @description 针对表【im_group】的数据库操作Mapper
* @createDate 2024-12-19 09:16:10
* @Entity generator.domain.ImGroup
*/
public interface ImGroupMapper extends BaseMapper<ImGroup> {

    /**
     * @description 获取加入的群的最大seq
     * @author cheng
     * @param []
     * @return java.lang.Long
     */
    @Select(" <script> " +
            " select max(sequence) from im_group where app_id = #{appId} and group_id in " +
            "<foreach collection='groupId' index='index' item='id' separator=',' close=')' open='('>" +
            " #{id} " +
            "</foreach>" +
            " </script> ")
    Long getGroupMaxSeq(Collection<String> groupId, String appId);
}




